package com.example.order.controller;

import com.example.common.AjaxResult;
import com.example.food.domain.Goods;
import com.example.order.domain.Order;
import com.example.order.service.OrderService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 订单Controller层
 * @author jiangshoutong
 */

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    OrderService orderService;

    //查询订单列表
    @ResponseBody
    @RequestMapping("/queryList")
    public AjaxResult queryList(Order o) throws Exception {
        return orderService.selectList(o);
    }

    //查询统计报表
    @ResponseBody
    @RequestMapping("/statistics")
    public AjaxResult statistics(Order o) throws Exception {
        return orderService.statistics(o);
    }

    //新增订单
    @RequestMapping("/add")
    public AjaxResult add(@RequestBody Order o) {
        return orderService.addOther(o);
    }

}
